<template>
  <view class="service-quick">
    <view class="service-quick__title">快捷服务</view>
    <view class="service-quick__items">
      <view 
        v-for="(item, index) in services" 
        :key="index" 
        class="service-quick__item"
        @click="onServiceClick(item, index)"
      >
        <view class="service-quick__icon">{{ item.icon }}</view>
        <view class="service-quick__name">{{ item.name }}</view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue';

const props = defineProps({
  services: {
    type: Array,
    default: () => []
  }
});

const emit = defineEmits(['click']);

const onServiceClick = (service, index) => {
  emit('click', { service, index });
};
</script>

<style lang="scss" scoped>
.service-quick {
  margin: 0 10px 15px;
  background-color: #fff;
  border-radius: 8px;
  padding: 15px;
  
  &__title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
  }
  
  &__items {
    display: flex;
    flex-wrap: wrap;
  }
  
  &__item {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
  }
  
  &__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f9eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 5px;
  }
  
  &__name {
    font-size: 12px;
    color: #333;
  }
}
</style>
